<center>
<h2>{$lang.useradmin}</h2>
<table class="usermessage" {if $CURRENT_USER->groupid eq 'ADMIN'} style="width: 800px" {else} style="width: 550px" {/if} border="0" cellpadding="0" cellspacing="0">
<tr>
	<td colspan="8" style="text-align: left">
	<b>{$lang.filterby}</b>
	</td>
<tr>
<tr>
<td style="text-align: right">
{$lang.status}
</td>
<td style="text-align: left">
	<select class="txt" onchange="addfilterUser('fstatusid',this)">
		<option value="">{$lang.all}</option>
		{foreach from=$statuslist item=strow}
			{eval var=$strow assign="stid"}
			<option value="{$stid}" {if $stid eq $statusid} selected {/if}>{$lang.$stid}</option>
		{/foreach}
	</select>
</td>
<td style="text-align: right">
{$lang.group}
</td>
<td style="text-align: left">
	<select class="txt" onchange="addfilterUser('fgroupid',this)">
		<option value="">{$lang.all}</option>
		{foreach from=$grouplist item=ptrow}
			{eval var=$ptrow assign="grid"}
			{if $CURRENT_USER->groupid eq 'ADMIN' OR ($CURRENT_USER->groupid neq 'ADMIN' AND $grid neq 'ADMIN')}
				<option value="{$ptrow}" {if $ptrow eq $groupid} selected {/if}>{$lang.$grid}</option>
			{/if}
		{/foreach}
	</select>
</td>
{if $CURRENT_USER->groupid eq 'ADMIN'}
<td style="text-align: right">
{$lang.team}
</td>
<td style="text-align: left">
	<select class="txt" onchange="addfilterUser('fteamid',this)">
		<option value="">{$lang.all}</option>
		{foreach from=$teamlist item=urow}
			<option value="{$urow->id}" {if $urow->id eq $teamid} selected {/if}>{$urow->name}</option>
		{/foreach}
	</select>
</td>
{/if}
</tr>
</table>
</center>

<center>
<form method="post" id="ulist_form">
	<input type="hidden" name="flowid" id="flowid" value="{$flowid}">
	<input type="hidden" name="action" id="action" value="useradmin">
	<input type="hidden" name="fstatusid" id="fstatusid" value="{$statusid}">
	<input type="hidden" name="fgroupid" id="fgroupid" value="{$groupid}">	
	<input type="hidden" name="fteamid" id="fteamid" value="{$team->teamid}">
	<input type="hidden" name="op" id="op" value="">	
	<input type="hidden" name="id" id="id" value="">
	<input type="hidden" name="newvalue" id="newvalue" value="">
	
	<table class="basetable" align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
	
		<thead>
			<tr>
				<th>{$lang.userid}</th>
				<th>{$lang.group}</th>
				<th>{$lang.team}</th>
				<th>{$lang.status}</th>
				<th>
					<img src="images/arrowdown.png" alt="" width="18" height="18" class="link" onclick="checkAll('userid[]')">
					<img src="images/arrowup.png" alt="" width="18" height="18" class="link" onclick="uncheckAll('userid[]')">
				</th>
			</tr>
		</thead>
	
		{* TABLE BODY - DYNAMIC *}
		<tbody id="user_list_content">
			{include file="userlistrow.tpl"}			
		</tbody>
	
		<tfoot>
			<tr>
				<th colspan="6">
					{include file="button.tpl" name=$lang.sendmp action="sendUserMessage(event)"}
					{include file="button.tpl" name=$lang.deactivate action="updateRequestUser('','deact')"}
					{include file="button.tpl" name=$lang.activate action="updateRequestUser('','act')"}
					{if $CURRENT_USER->groupid eq 'ADMIN'}
						{include file="button.tpl" name=$lang.resetpwd action="updateRequestUser('','reset')"}
						{include file="button.tpl" name=$lang.remove action="deleteUser()"}
					{/if}
				</th>
			</tr>
		</tfoot>
	
	</table>
</form>
</center>
